/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.ereconquista.modelo;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

/**
 *
 * @author Claudio
 */
@Entity
@Table(name = "categorias_empresas")
public class CategoriaEmpresa implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(nullable = false)
    private Long id;
    @Basic(optional = false)
    @Column(nullable = false, length = 250)
    private String descrip;
    @Basic(optional = false)
    @Column(name = "fk_subcategoria", nullable = false)
    private long fkSubcategoria;

    public CategoriaEmpresa() {
    }

    public CategoriaEmpresa(Long id) {
        this.id = id;
    }

    public CategoriaEmpresa(Long id, String descrip, long fkSubcategoria) {
        this.id = id;
        this.descrip = descrip;
        this.fkSubcategoria = fkSubcategoria;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getDescrip() {
        return descrip;
    }

    public void setDescrip(String descrip) {
        this.descrip = descrip;
    }

    public long getFkSubcategoria() {
        return fkSubcategoria;
    }

    public void setFkSubcategoria(long fkSubcategoria) {
        this.fkSubcategoria = fkSubcategoria;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CategoriaEmpresa)) {
            return false;
        }
        CategoriaEmpresa other = (CategoriaEmpresa) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.ereconquista.modelo.CategoriaEmpresa[ id=" + id + " ]";
    }
    
}
